
function importHeader()
{
    $("#header").html("<!-- 头部 start -->\n" +
        "\n" +
        "<script src=\"js/getParameter.js\"></script>\n" +
        "<script>\n" +
        "    $(function () {\n" +
        "        //查询用户信息\n" +
        "        $.get(\"user/findOne\",{},function (data) {\n" +
        "           //{uid:1,name:'李四'}\n" +
        "           var msg = \"欢迎回来，\"+data.name;\n" +
        "           $(\"#span_username\").html(msg);\n" +
        "\n" +
        "       });\n" +
        "\n" +
        "       //查询分类数据\n" +
        "        $.get(\"category/findAll\",{},function (data) {\n" +
        "            //[{cid:1,cname:国内游},{},{}]\n" +
        "            var lis = '<li class=\"nav-active\"><a href=\"index.html\">首页</a></li>';\n" +
        "            //遍历数组,拼接字符串(<li>)\n" +
        "            for (var i = 0; i < data.length; i++) {\n" +
        "                var li = '<li><a href=\"route_list.html?cid='+data[i].cid+'\">'+data[i].cname+'</a></li>';\n" +
        "\n" +
        "                lis += li;\n" +
        "                \n" +
        "            }\n" +
        "            \n" +
        "\n" +
        "            //拼接收藏排行榜的li,<li><a href=\"favoriterank.html\">收藏排行榜</a></li>\n" +
        "            \n" +
        "            lis+= '<li><a href=\"favoriterank.html\">收藏排行榜</a></li>';\n" +
        "\n" +
        "            //将lis字符串，设置到ul的html内容中\n" +
        "            $(\"#category\").html(lis);\n" +
        "        });\n" +
        "\n" +
        "\n" +
        "        //给搜索按钮绑定单击事件，获取搜索输入框的内容\n" +
        "        $(\"#search-button\").click(function () {\n" +
        "            //线路名称\n" +
        "            var rname = $(\"#search_input\").val();\n" +
        "\n" +
        "            var cid = getParameter(\"cid\");\n" +
        "            // 跳转路径 http://localhost/travel/route_list.html?cid=5，拼接上rname=xxx\n" +
        "            location.href=\"http://localhost/travel/route_list.html?cid=\"+cid+\"&rname=\"+rname;\n" +
        "        });\n" +
        "    });\n" +
        "\n" +
        "</script>\n" +
        "\n" +
        "<header id=\"header\">\n" +
        "        <div class=\"top_banner\">\n" +
        "           <img  width='100%' height='128px' src=\"images/top_banner.jpg\" alt=\"\">\n" +
        "        </div>\n" +
        "        <div class=\"shortcut\">\n" +
        "            <!-- 未登录状态  -->\n" +
        "            <div class=\"login_out\">\n" +
        "                <a href=\"login.html\">登录</a>\n" +
        "                <a href=\"register.html\">注册</a>\n" +
        "            </div>\n" +
        "            <!-- 登录状态  -->\n" +
        "            <div class=\"login\">\n" +
        "            \t\n" +
        "                <span id=\"span_username\">欢迎回来,张三</span>\n" +
        "                <a href=\"myfavorite.html\" class=\"collection\">我的收藏</a>\n" +
        "                <a href=\"javascript:location.href='login.html'\">退出</a>\n" +
        "            </div>\n" +
        "        </div>\n" +
        "        <div class=\"header_wrap\">\n" +
        "            <div class=\"topbar\">\n" +
        "                <div class=\"logo\">\n" +
        "                    <a href=\"/\"><img width='207px' height='56px' src=\"images/logo.jpg\" alt=\"\"></a>\n" +
        "                </div>\n" +
        "                <div class=\"search\">\n" +
        "                    <input name=\"\" id=\"search_input\"  type=\"text\" title='请输入关键字' class=\"search_input\" autocomplete=\"off\">\n" +
        "                    <a href=\"javascript:;\" id=\"search-button\" class=\"search-button\">搜索</a>\n" +
        "                </div>\n" +
        "                <div class=\"hottel\">\n" +
        "                    <div class=\"hot_pic\">\n" +
        "                        <img src=\"images/hot_tel.jpg\" alt=\"\">\n" +
        "                    </div>\n" +
        "                    <div class=\"hot_tel\">\n" +
        "                        <p class=\"hot_time\">客服热线(9:00-6:00)</p>\n" +
        "                        <p class=\"hot_num\">1234-5678</p>\n" +
        "                    </div>\n" +
        "                </div>\n" +
        "            </div>\n" +
        "        </div>\n" +
        "    </header>\n" +
        "    <!-- 头部 end -->\n" +
        "     <!-- 首页导航 -->\n" +
        "    <div class=\"navitem\">\n" +
        "        <ul id=\"category\" class=\"nav\">\n" +
        "            <li class=\"nav-active\"><a href=\"index.html\">首页</a></li>\n" +
        "            <li><a  href=\"route_list.html\">产品中心</a></li>\n" +
        "            <li><a href=\"buissnessCom.html\">商务合作</a></li>\n" +
        "            <li><a href=\"milkKonwledge.html\">牛奶小知识</a></li>\n" +
        "            <li><a href=\"favoriterank.html\">产品排行榜</a></li>\n" +
        "            <li><a href=\"aboutUs.html\">关于我们</a></li>\n" +
        "        </ul>\n" +
        "    </div>\n" +
        "    ");
}
function importFooter()
{
    $("#footer").html(" <!-- 尾部 start-->\n" +
        "    <footer id=\"footer\">\n" +
        "        <div class=\"why_select\">\n" +
        "            <dl>\n" +
        "                <dt class=\"fl\">\n" +
        "                    <img src=\"images/icon_1.jpg\" alt=\"\">\n" +
        "                </dt>\n" +
        "                <dd>\n" +
        "                    <h1>产品齐全</h1>\n" +
        "                    <h2>产品全天然，随心买</h2>\n" +
        "                </dd>\n" +
        "            </dl>\n" +
        "            <dl>\n" +
        "                <dt class=\"fl\">\n" +
        "                    <img src=\"images/icon_2.jpg\" alt=\"\">\n" +
        "                </dt>\n" +
        "                <dd>\n" +
        "                    <h1>便利快捷</h1>\n" +
        "                    <h2>24小时不打烊，随时购</h2>\n" +
        "                </dd>\n" +
        "            </dl>\n" +
        "            <dl>\n" +
        "                <dt class=\"fl\">\n" +
        "                    <img src=\"images/icon_3.jpg\" alt=\"\">\n" +
        "                </dt>\n" +
        "                <dd>\n" +
        "                    <h1>安全支付</h1>\n" +
        "                    <h2>保障支付，放心买</h2>\n" +
        "                </dd>\n" +
        "            </dl>\n" +
        "            <dl>\n" +
        "                <dt class=\"fl\">\n" +
        "                    <img src=\"images/icon_4.jpg\" alt=\"\">\n" +
        "                </dt>\n" +
        "                <dd style=\"margin-right:0px;\">\n" +
        "                    <h1>贴心服务</h1>\n" +
        "                    <h2>客服全年无休，安心买</h2>\n" +
        "                </dd>\n" +
        "            </dl>\n" +
        "        </div>\n" +
        "        <div class=\"company\">\n" +
        "            <p>zcj 版权所有Copyright 2006-2018, All Rights Reserved 黑ICP备16007882</p>\n" +
        "        </div>\n" +
        "    </footer>");
}
